package model.inventory;
// Generated Oct 27, 2012 8:43:23 AM by Hibernate Tools 3.2.1.GA


import java.math.BigDecimal;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * MstItemBalance generated by hbm2java
 */
@Entity
@Table(name="mst_item_balance"
    ,schema="inventory"
)
public class ItemBalance  implements java.io.Serializable {


     private ItemBalanceId id;
     private Item mstItem;
     private BigDecimal balance;

    public ItemBalance() {
    }

	
    public ItemBalance(ItemBalanceId id, Item mstItem) {
        this.id = id;
        this.mstItem = mstItem;
    }
    public ItemBalance(ItemBalanceId id, Item mstItem, BigDecimal balance) {
       this.id = id;
       this.mstItem = mstItem;
       this.balance = balance;
    }
   
     @EmbeddedId
    
    @AttributeOverrides( {
        @AttributeOverride(name="itemId", column=@Column(name="item_id", nullable=false) ), 
        @AttributeOverride(name="gudangId", column=@Column(name="gudang_id", nullable=false) ), 
        @AttributeOverride(name="balanceDate", column=@Column(name="balance_date", nullable=false, length=13) ) } )
    public ItemBalanceId getId() {
        return this.id;
    }
    
    public void setId(ItemBalanceId id) {
        this.id = id;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="item_id", nullable=false, insertable=false, updatable=false)
    public Item getMstItem() {
        return this.mstItem;
    }
    
    public void setMstItem(Item mstItem) {
        this.mstItem = mstItem;
    }
    
    @Column(name="balance", precision=12)
    public BigDecimal getBalance() {
        return this.balance;
    }
    
    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }




}


